﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;

namespace SGameDAL
{
   public class LoginDAL
    {
        #region 登录
        public object GetLongin(string act,String pwd)
        {
            string sql = "select ID from Demo_Uesr where Account=@acc and Password=@pwd";
            SqlParameter[] para = {
            new SqlParameter("@acc",act),
            new SqlParameter("@pwd",pwd)
            };
            return SQLHelper.ExecuteScalar(sql, para);
        }
        #endregion
        #region 注册
        public int GetReg(string act, String pwd)
        {
            string sql = "insert into Demo_Uesr values(@accc,@pawd)";
            SqlParameter[] sqlParameters = {
            new SqlParameter("@accc",act),
             new SqlParameter("@pawd",pwd)
            };
            return SQLHelper.ExecuteNonQuery(sql, sqlParameters);
        }
        #endregion
    }
}
